local 坐骑资料库 = class()
local 读取坐骑 = require("script/属性控制/坐骑")
local insert = table.insert

function 坐骑资料库:初始化()
end

function 坐骑资料库:获取坐骑(id, 模型, 名称, 类型, 属性, 等级, 染色方案, 技能组, 资质组, 成长, 参战等级, 属性表)
	local n = 读取坐骑()
	local mx = 模型 == "小毛头" or 模型 == "小丫丫"

	if mx then
		类型 = "孩子"
	end

	n:置新对象(模型, 名称, 类型, 属性, 等级, 染色方案, 技能组, 资质组, 成长, 参战等级, 属性表, id)

	if #玩家数据[id].角色.数据.坐骑列表 <= 玩家数据[id].角色.数据.坐骑携带数量 then
		insert(玩家数据[id].角色.数据.坐骑列表, n)
	else
		常规提示(id, 玩家数据[id].角色.数据.名称 .. "携带的坐骑已到上限无法再获得坐骑，请放生一只坐骑")
	end
end

function 坐骑资料库:增加坐骑(id, 坐骑)
	if 坐骑 == nil then
		return
	end

	local 坐骑物品 = {
		坐骑
	}

	if 玩家数据[id].角色.数据.坐骑列表 == nil then
		玩家数据[id].角色.数据.坐骑列表 = {}
	end

	insert(玩家数据[id].角色.数据.坐骑列表, 坐骑物品)
end

function 坐骑资料库:取坐骑库(人物)
	local zqsQQ = nil

	if math.ceil(取随机数(1, 10000) / 100) <= 50 then
		if 人物.模型 ~= "偃无师" and 人物.模型 ~= "鬼潇潇" and 人物.模型 ~= "桃夭夭" then
			zqsQQ = "神气小龟"
		else
			zqsQQ = "宝贝葫芦"
		end
	elseif 人物.模型 ~= "龙太子" and 人物.模型 ~= "骨精灵" then
		zqsQQ = "宝贝葫芦"
	else
		zqsQQ = "神气小龟"
	end

	local aa = math.ceil(取随机数(1, 3000) / 1000)

	if 人物.种族 == "人" and 人物.模型 ~= "偃无师" then
		if aa == 1 then
			zqsQQ = "汗血宝马"
		elseif aa == 2 then
			zqsQQ = "欢喜羊羊"
		end
	elseif 人物.种族 == "魔" and 人物.模型 ~= "鬼潇潇" then
		if aa == 1 then
			zqsQQ = "魔力斗兽"
		elseif aa == 2 then
			zqsQQ = "披甲战狼"
		end
	elseif 人物.种族 == "仙" and 人物.模型 ~= "桃夭夭" then
		if aa == 1 then
			zqsQQ = "闲云野鹤"
		elseif aa == 2 then
			zqsQQ = "云魅仙鹿"
		end
	end

	return zqsQQ
end

function 坐骑资料库:取坐骑库1(人物)
	local zqsQQ = "蓝色狐狸"

	if 人物.种族 == "人" or 人物.种族 == "魔" or 人物.种族 == "仙" then
		local zqsQ = qz2(取随机数(1, #坐骑转换模型 * 1000) / 1000)
		zqsQQ = 坐骑转换模型[zqsQ]
	end

	return zqsQQ
end

function 坐骑资料库:取坐骑饰品(bb)
	if bb == "云魅仙鹿" then
		return ""
	end
end

function 坐骑资料库:取坐骑(bb)
	local bbs = {}
	local 数量 = 取随机数(1, 3)
	local 坐骑技能 = {}
	local ms = {
		"反震",
		"吸血",
		"反击",
		"连击",
		"飞行",
		"感知",
		"再生",
		"冥思",
		"慧根",
		"必杀",
		"幸运",
		"神迹",
		"招架",
		"永恒",
		"偷袭",
		"毒",
		"驱鬼",
		"鬼魂术",
		"魔之心",
		"神佑复生",
		"精神集中",
		"法术连击",
		"法术暴击",
		"法术波动",
		"土属性吸收",
		"火属性吸收",
		"水属性吸收"
	}

	for i = 1, 数量 do
		local 随机技能 = 取随机数(1, #ms)

		table.insert(坐骑技能, ms[随机技能])
		table.remove(ms, 随机技能)
	end

	if bb == "神行百变" or bb == "百变坐骑" then
		bbs[1] = 45
		bbs[2] = 300
		bbs[3] = 300
		bbs[4] = 300
		bbs[5] = 300
		bbs[6] = 300
		bbs[7] = 300
		bbs[8] = {
			1.5,
			1.5,
			1.5,
			1.5,
			1.5
		}
		bbs[9] = 列表2加入到列表1({
			"风起龙游【伪】"
		}, 取低级要诀(3))
		bbs[10] = 取随机数(500000, 500000)
	elseif bb == "汗血宝马" or bb == "欢喜羊羊" or bb == "魔力斗兽" or bb == "披甲战狼" or bb == "闲云野鹤" or bb == "云魅仙鹿" or bb == "神气小龟" or bb == "宝贝葫芦" then
		bbs[1] = 45
		bbs[2] = 100
		bbs[3] = 100
		bbs[4] = 100
		bbs[5] = 100
		bbs[6] = 100
		bbs[7] = 100
		bbs[8] = {
			1,
			1,
			1.05,
			1.05,
			1.1
		}
		bbs[9] = 坐骑技能
		bbs[10] = 取随机数(10000, 10000)
	elseif bb == "粉红小驴" or bb == "腾云仙牛" or bb == "轻云羊驼" or bb == "魔骨战熊" or bb == "月影天马" or bb == "怒雷狂狮" or bb == "玄火神驹" or bb == "妙缘暖犀" or bb == "沉星寒犀" or bb == "飞天猪猪" or bb == "猪猪小侠" or bb == "鹤雪锦犀" or bb == "暗影战豹" or bb == "莽林猛犸" or bb == "琉璃宝象" or bb == "九霄冰凤" or bb == "战火穷奇" or bb == "玄冰灵虎" or bb == "御风灵貂" or bb == "青霄天麟" or bb == "踏雪灵熊" or bb == "天使猪猪" or bb == "九尾神狐" or bb == "金鳞仙子" or bb == "银色穷奇" or bb == "七彩神驴" or bb == "蓝色狐狸" or bb == "黄金狮子" or bb == "七彩祥云" or bb == "粉红火鸡" or bb == "彩虹毛驴" or bb == "粉嫩小猪" or bb == "水晶芭蕉" or bb == "深海狂鲨" or bb == "雷霆黑豹" or bb == "九尾妖狐" or bb == "炫彩灵鹿" or bb == "鹰狮角兽" or bb == "晶角仙羊" or bb == "宝贝葫芦·蓝" or bb == "巨角黑羊" or bb == "白兔萝卜" then
		bbs[1] = 45
		bbs[2] = 130
		bbs[3] = 130
		bbs[4] = 130
		bbs[5] = 130
		bbs[6] = 130
		bbs[7] = 130
		bbs[8] = {
			1.1,
			1.15,
			1.15,
			1.2,
			1.2
		}
		bbs[9] = 坐骑技能
		bbs[10] = 取随机数(10000, 10000)
	else
		bbs[1] = 45
		bbs[2] = 150
		bbs[3] = 150
		bbs[4] = 150
		bbs[5] = 150
		bbs[6] = 150
		bbs[7] = 150
		bbs[8] = {
			1.1,
			1.15,
			1.15,
			1.2,
			1.25
		}
		bbs[9] = 坐骑技能
		bbs[10] = 取随机数(10000, 10000)
	end

	return bbs
end

function 坐骑资料库:补差(zq)
	local zqs = {
		y = 0,
		x = 0
	}

	if zq == "蝎子坐骑" then
		zqs.y = 0
		zqs.x = 0

		return zqs.x, zqs.y
	elseif zq == "小狐狸坐骑" then
		zqs.y = 0
		zqs.x = 0

		return zqs.x, zqs.y
	elseif zq == "大黑虎坐骑" then
		zqs.y = 0
		zqs.x = 0

		return zqs.x, zqs.y
	elseif zq == "飞天黄金狮坐骑2" then
		zqs.y = 0
		zqs.x = 0

		return zqs.x, zqs.y
	end

	return zqs.x, zqs.y
end

function 坐骑资料库:坐骑库(id, zq, sp, sp2)
	if sp2 == nil then
		sp2 = "空"
	end

	if sp == nil then
		sp = "空"
	end

	local zqs = {
		宝贝葫芦 = {
			1673636356,
			2476436130.0,
			1,
			"shape.wd5"
		},
		神气小龟 = {
			15237971,
			1881542867,
			2,
			"shape.wd5"
		},
		汗血宝马 = {
			2068445850,
			1064760754,
			3,
			"shape.wd5"
		},
		欢喜羊羊 = {
			2370681518.0,
			641074748,
			4,
			"shape.wd5"
		},
		魔力斗兽 = {
			1259214577,
			687294878,
			3,
			"shape.wd5"
		},
		披甲战狼 = {
			3869897,
			4139216761.0,
			4,
			"shape.wd5"
		},
		闲云野鹤 = {
			1238021929,
			356842413,
			3,
			"shape.wd5"
		},
		云魅仙鹿 = {
			1646186311,
			160267698,
			4,
			"shape.wd5"
		},
		飞天黄金狮坐骑 = {
			2661836695.0,
			2071223780,
			2,
			"shape.wdc"
		},
		飞天黄金狮坐骑2 = {
			2151750050.0,
			4066395981.0,
			2,
			"shape.wdc"
		},
		未知坐骑3 = {
			3864463326.0,
			3864463326.0,
			3,
			"shape.wdc"
		},
		大黑虎坐骑 = {
			862359447,
			3714510492.0,
			2,
			"shape.wdc"
		},
		黄金象坐骑 = {
			3639137792.0,
			1198644899,
			3,
			"shape.wdc"
		},
		飞天猪坐骑粉 = {
			3554320680.0,
			3554320680.0,
			3,
			"shape.wdc"
		},
		飞天猪坐骑黑 = {
			3411089563.0,
			3137674729.0,
			3,
			"shape.wdc"
		},
		小狐狸坐骑 = {
			3338588871.0,
			3338588871.0,
			2,
			"shape.wdc"
		},
		蝎子坐骑 = {
			2499645734.0,
			0xFCB0282F,
			2,
			"shape.wdc"
		},
		未知坐骑1 = {
			0xFC14DF68,
			0xFC14DF68,
			3,
			"shape.wdb"
		},
		七彩神驴 = {
			56835591,
			17042894,
			3,
			"shape.wd5"
		},
		银色穷奇 = {
			87484832,
			37633431,
			3,
			"shape.wd5"
		},
		天使猪猪 = {
			39098629,
			89666517,
			3,
			"shape.wd5"
		},
		九尾神狐 = {
			63445121,
			65354479,
			2,
			"shape.wd5"
		},
		金鳞仙子 = {
			95618601,
			106733096,
			3,
			"shape.wd5"
		},
		踏雪灵熊 = {
			125037460,
			600368606,
			3,
			"shape.wd5"
		},
		九霄冰凤 = {
			148609160,
			203846057,
			3,
			"shape.wd5"
		},
		战火穷奇 = {
			173615016,
			199092066,
			3,
			"shape.wd5"
		},
		玄冰灵虎 = {
			174362472,
			177164894,
			3,
			"shape.wd5"
		},
		御风灵貂 = {
			1540316027,
			174994245,
			3,
			"shape.wd5"
		},
		青霄天麟 = {
			196776716,
			4122355276.0,
			3,
			"shape.wd5"
		},
		琉璃宝象 = {
			3223156056.0,
			875595699,
			3,
			"shape.wd5"
		},
		莽林猛犸 = {
			3196833113.0,
			518002686,
			3,
			"shape.wd5"
		},
		暗影战豹 = {
			579061988,
			627781122,
			4,
			"shape.wd5"
		},
		鹤雪锦犀 = {
			742982661,
			1643484989,
			3,
			"shape.wd5"
		},
		猪猪小侠 = {
			760963512,
			912948585,
			3,
			"shape.wd5"
		},
		飞天猪猪 = {
			762923247,
			3642317480.0,
			3,
			"shape.wd5"
		},
		沉星寒犀 = {
			1139260959,
			2009166956,
			3,
			"shape.wd5"
		},
		妙缘暖犀 = {
			1378365378,
			2218268333.0,
			3,
			"shape.wd5"
		},
		玄火神驹 = {
			1426370750,
			3906810689.0,
			3,
			"shape.wd5"
		},
		怒雷狂狮 = {
			3962679099.0,
			1441069916,
			3,
			"shape.wd5"
		},
		月影天马 = {
			3372770369.0,
			1992507026,
			3,
			"shape.wd5"
		},
		魔骨战熊 = {
			3142175666.0,
			2185751491.0,
			3,
			"shape.wd5"
		},
		轻云羊驼 = {
			2615037717.0,
			3317912158.0,
			3,
			"shape.wd5"
		},
		粉红小驴 = {
			3345308803.0,
			2907212221.0,
			3,
			"shape.wd5"
		},
		独角兽 = {
			0xFF100011,
			0xFF100010,
			5,
			"jy.wdf"
		},
		独角兽1 = {
			808464406,
			808464407,
			6,
			"jy.wdf"
		},
		海豚恋人 = {
			3145984,
			3145985,
			5,
			"jy.wdf"
		},
		冰晶魅灵 = {
			3147265,
			3147266,
			6,
			"wzife.wd5"
		},
		炫影天马 = {
			33620517,
			33620518,
			5,
			"wzife.wd5"
		},
		玲珑雪狐 = {
			16777336,
			16777335,
			7,
			"wzife.wd5"
		},
		玲珑雪狐女 = {
			16777344,
			16777337,
			5,
			"wzife.wd5"
		},
		烈焰雄狮 = {
			16777347,
			16777346,
			5,
			"wzife.wd5"
		},
		九尾神狐1 = {
			16777348,
			16777349,
			8,
			"wzife.wd5"
		}
	}
	local sps = {
		展翅高飞 = {
			767651572,
			1202036332,
			"shape.wd5"
		},
		旗开得胜 = {
			1337435717,
			3365637499.0,
			"shape.wd5"
		},
		霸王雄风 = {
			2328187214.0,
			3540063934.0,
			"shape.wd5"
		},
		独眼观天 = {
			3410083591.0,
			1832997714,
			"shape.wd5"
		},
		威武不屈 = {
			3817158459.0,
			1912471893,
			"shape.wd5"
		},
		深藏不露 = {
			623502757,
			1371552980,
			"shape.wd5"
		},
		异域浓情 = {
			3904069270.0,
			961136489,
			"shape.wd5"
		},
		流星天马 = {
			1917361405,
			1293116245,
			"shape.wd5"
		},
		威猛将军 = {
			1541121995,
			1557944926,
			"shape.wd5"
		},
		知情达理 = {
			3435078840.0,
			0xFE4B37F2,
			"shape.wd5"
		},
		气宇轩昂 = {
			3964406239.0,
			1471190751,
			"shape.wd5"
		},
		如花似玉 = {
			2794876882.0,
			3397936337.0,
			"shape.wd5"
		},
		傲视天下 = {
			3146803588.0,
			39098628,
			"shape.wd5"
		},
		铁血豪情 = {
			1949286169,
			272628627,
			"shape.wd5"
		},
		唯我独尊 = {
			2138045493,
			1902861761,
			"shape.wd5"
		},
		叱诧风云 = {
			535629016,
			3639306368.0,
			"shape.wd5"
		},
		异域风情 = {
			2868932964.0,
			773288833,
			"shape.wd5"
		},
		假面勇者 = {
			3888873989.0,
			241259524,
			"shape.wd5"
		},
		霓裳魅影 = {
			3771402184.0,
			3654899942.0,
			"shape.wd5"
		},
		披星戴月 = {
			2396444876.0,
			3319330109.0,
			"shape.wd5"
		},
		烈焰燃情 = {
			2354535718.0,
			2064996618,
			"shape.wd5"
		},
		天雨流芳 = {
			1346320715,
			599745915,
			"shape.wd5"
		},
		灵光再现 = {
			3302037701.0,
			3418788618.0,
			"shape.wd5"
		},
		倾国倾城 = {
			520206526,
			3181698475.0,
			"shape.wd5"
		},
		空 = {}
	}
	local scs = nil

	if id == "飞燕女" then
		scs = {
			{
				1150439470,
				4141274598.0,
				"shape.wd5"
			},
			{
				3703129836.0,
				3704114510.0,
				"shape.wd5"
			},
			{
				3741446813.0,
				2809877988.0,
				"shape.wd5"
			},
			{
				1846203257,
				2278008400.0,
				"shape.wd5"
			}
		}
	elseif id == "英女侠" then
		scs = {
			{
				3560510121.0,
				3537160915.0,
				"shape.wd5"
			},
			{
				1881742416,
				818593561,
				"shape.wd5"
			},
			{
				1919695150,
				1761286505,
				"shape.wd5"
			},
			{
				611612315,
				2899863774.0,
				"shape.wd5"
			}
		}
	elseif id == "巫蛮儿" then
		scs = {
			{
				4072444777.0,
				2971625026.0,
				"shape.wda"
			},
			{
				2608056159.0,
				3658124038.0,
				"shape.wda"
			},
			{
				794733887,
				1235197239,
				"shape.wda"
			},
			{
				3435173980.0,
				3371527075.0,
				"shape.wda"
			}
		}
	elseif id == "偃无师" then
		scs = {
			{
				272,
				273,
				"common/shape.wda"
			},
			{
				0,
				0,
				"common/shape.wda"
			},
			{
				0,
				0,
				"common/shape.wda"
			},
			{
				0,
				0,
				"common/shape.wda"
			}
		}
	elseif id == "逍遥生" then
		scs = {
			{
				2740228553.0,
				1238878062,
				"shape.wd5"
			},
			{
				3077630676.0,
				2585033176.0,
				"shape.wd5"
			},
			{
				1993746922,
				0xFB50C58F,
				"shape.wd5"
			},
			{
				1027157748,
				2782931557.0,
				"shape.wd5"
			}
		}
	elseif id == "剑侠客" then
		scs = {
			{
				1729109175,
				2626130106.0,
				"shape.wd5"
			},
			{
				853185923,
				3969567073.0,
				"shape.wd5"
			},
			{
				124154653,
				2354066826.0,
				"shape.wd5"
			},
			{
				2841252461.0,
				1363009132,
				"shape.wd5"
			}
		}
	elseif id == "狐美人" then
		scs = {
			{
				3809623002.0,
				2506294709.0,
				"shape.wd5"
			},
			{
				0xFB798485,
				3516494869.0,
				"shape.wd5"
			},
			{
				1690442339,
				3587373588.0,
				"shape.wd5"
			},
			{
				3168300506.0,
				4026933254.0,
				"shape.wd5"
			}
		}
	elseif id == "骨精灵" then
		scs = {
			{
				3203348373.0,
				1013709199,
				"shape.wd5"
			},
			{
				3804351972.0,
				3134256913.0,
				"shape.wd5"
			},
			{
				1974509473,
				1582773998,
				"shape.wd5"
			},
			{
				2212319443.0,
				3092020280.0,
				"shape.wd5"
			}
		}
	elseif id == "鬼潇潇" then
		scs = {
			{
				280,
				281,
				"common/shape.wdc"
			},
			{
				0,
				0,
				"common/shape.wdc"
			},
			{
				0,
				0,
				"common/shape.wdc"
			},
			{
				0,
				0,
				"common/shape.wdc"
			}
		}
	elseif id == "杀破狼" then
		scs = {
			{
				3778520413.0,
				3679793809.0,
				"shape.wda"
			},
			{
				2347398701.0,
				351170825,
				"shape.wda"
			},
			{
				74086885,
				63788100,
				"shape.wda"
			},
			{
				261573867,
				1420357782,
				"shape.wda"
			}
		}
	elseif id == "巨魔王" then
		scs = {
			{
				569209373,
				1510334912,
				"shape.wd5"
			},
			{
				2650714435.0,
				2009204344,
				"shape.wd5"
			},
			{
				452334353,
				1849101638,
				"shape.wd5"
			},
			{
				3423872749.0,
				972949979,
				"shape.wd5"
			}
		}
	elseif id == "虎头怪" then
		scs = {
			{
				2578285773.0,
				2678510899.0,
				"shape.wd5"
			},
			{
				4117103569.0,
				2212215444.0,
				"shape.wd5"
			},
			{
				939506143,
				1682075539,
				"shape.wd5"
			},
			{
				2512127013.0,
				3322229368.0,
				"shape.wd5"
			}
		}
	elseif id == "舞天姬" then
		scs = {
			{
				1423658829,
				3413255956.0,
				"shape.wd5"
			},
			{
				3643786206.0,
				2157921022.0,
				"shape.wd5"
			},
			{
				556288161,
				2866269075.0,
				"shape.wd5"
			},
			{
				3025008437.0,
				3970292553.0,
				"shape.wd5"
			}
		}
	elseif id == "玄彩娥" then
		scs = {
			{
				2250171609.0,
				2670697489.0,
				"shape.wd5"
			},
			{
				857114492,
				838300931,
				"shape.wd5"
			},
			{
				125412319,
				1646683356,
				"shape.wd5"
			},
			{
				2801629264.0,
				3120405949.0,
				"shape.wd5"
			}
		}
	elseif id == "桃夭夭" then
		scs = {
			{
				265,
				272,
				"common/shape.wdb"
			},
			{
				0,
				0,
				"common/shape.wdb"
			},
			{
				0,
				0,
				"common/shape.wdb"
			},
			{
				0,
				0,
				"common/shape.wdb"
			}
		}
	elseif id == "羽灵神" then
		scs = {
			{
				2100425790,
				1994712022,
				"shape.wda"
			},
			{
				2072421876,
				3835077335.0,
				"shape.wda"
			},
			{
				2154962986.0,
				1697181715,
				"shape.wda"
			},
			{
				1270678246,
				1766466411,
				"shape.wda"
			}
		}
	elseif id == "神天兵" then
		scs = {
			{
				1997554435,
				3157786639.0,
				"shape.wd5"
			},
			{
				4109342901.0,
				2087916801,
				"shape.wd5"
			},
			{
				2137852331,
				330112035,
				"shape.wd5"
			},
			{
				1621392417,
				1670580820,
				"shape.wd5"
			}
		}
	elseif id == "龙太子" then
		scs = {
			{
				1327998367,
				2149532557.0,
				"shape.wd5"
			},
			{
				1190460918,
				3387893585.0,
				"shape.wd5"
			},
			{
				1527700909,
				2988954527.0,
				"shape.wd5"
			},
			{
				1681882590,
				3431860513.0,
				"shape.wd5"
			}
		}
	end

	local bh = zqs[zq][3]

	return {
		坐骑资源 = zqs[zq][4],
		坐骑站立 = zqs[zq][1],
		坐骑行走 = zqs[zq][2],
		人物资源 = scs[bh][3],
		人物站立 = scs[bh][1],
		人物行走 = scs[bh][2],
		坐骑饰品站立 = sps[sp][1],
		坐骑饰品行走 = sps[sp][2],
		坐骑饰品资源 = sps[sp][3],
		坐骑饰品2站立 = sps[sp2][1],
		坐骑饰品2行走 = sps[sp2][2],
		坐骑饰品2资源 = sps[sp2][3]
	}
end

return 坐骑资料库
